package loop;

public class Binomial_Array {
    public static void main(String[] args) {
//        int[][] arr = new int[10][10] ;
//        arr[0][0] = 1 ;
//
//        for (int i = 0; i < 9; i++) {
//            for (int j = 0; j <= i ; j++) {
//                arr[i+1][j+1] = arr[i][j]+arr[i][j+1];
//                System.out.print(arr[i+1][j+1] + "  ");
//            }
//            System.out.println();
//        }
        int[][] arr = new int[9][9] ;
        for (int i = 0; i < 9; i++) {
            for (int j = 0; j <= i ; j++) {
                if(j == 0){
                    arr[i][j] = 1 ;
                    System.out.print(arr[i][j] + "  ");
                }else{
                    arr[i][j] = arr[i-1][j-1]+arr[i-1][j];
                    System.out.print(arr[i][j] + "  ");
                }

            }
            System.out.println();
        }

    }
}
